package com.wuyi.service;

import com.zc.utils.JSONResult;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.OutputStream;

/**
 * @author 曾川
 * @version 1.0.0
 * @ClassName FileUploadService.java
 * @Description 上传服务接口
 * @createTime 2021年11月11日 17:29:00
 */
public interface FileUploadService {


    /**
     * 文件上传至OSS (适合小文件)
     * @param file
     * @param userName
     * @param uploadType
     * @return
     * @throws IOException
     */
    public String upload(MultipartFile file,String userName, String uploadType) throws IOException;

    /**
     * 分片上传（适合大文件）
     * @param file
     * @param userName
     * @param uploadType
     * @return
     * @throws IOException
     */
    public String upload2(MultipartFile file,String userName, String uploadType) throws IOException;

    /**
     * 从OSS下载文件至本地
     * @param path
     * @param response
     * @throws IOException
     */
    public void download(String path, HttpServletResponse response) throws IOException;

}
